import numpy as NP
import numpy.linalg as LA

# generate some data
fnx = lambda : NP.random.randint(0, 10, 10)
s1, s2 = fnx(), fnx()

# a function to calculate cosine similarity
cx = lambda a, b : round(NP.inner(a, b)/(LA.norm(a)*LA.norm(b)), 2)

cx(s1, s2)

a = [[0.30833333333333335, 0.033333333333333326, -0.4095238095238095, -0.018681318681318677, 0.39632107023411367, -0.32187938288920054, 0.12239089184060721, -0.1638655462184874, 0.7285714285714286, -0.4], [0.30833333333333335, 0.033333333333333326, -0.4095238095238095, -0.018681318681318677, 0.39632107023411367, -0.32187938288920054, 0.12239089184060721, -0.1638655462184874], [-0.09848484848484851, 0.2010489510489511, -0.2692307692307693, -0.19117647058823528, 0.5126050420168067, -0.0714285714285714, -0.25, 0.4772727272727273, -0.10227272727272729, 0.17500000000000004, 0.0, 0.19999999999999996, 0.0, -0.4, 0.4, -0.75, 0.75, -0.8181818181818181], [-0.2692307692307693, -0.19117647058823528, 0.6684491978609626, -0.10227272727272729, 0.17500000000000004, 0.0, 0.19999999999999996, 0.0, -0.4, 0.4, -0.5, 0.5, 0.0, -0.6, 0.0444444444444444, 0.05555555555555558], [-0.2692307692307693, -0.19117647058823528, 0.5126050420168067, -0.0714285714285714, -0.25, 0.4772727272727273, -0.10227272727272729, 0.17500000000000004, 0.0, 0.19999999999999996, 0.0, -0.4], [-0.2692307692307693, -0.19117647058823528, 0.5126050420168067, -0.0714285714285714, 0.2272727272727273, -0.10227272727272729, 0.17500000000000004, 0.0, 0.19999999999999996, 0.0, -0.4, 0.4, -0.75, 0.75, -0.8181818181818181, 0.8181818181818181, -0.5, 0.5, 0.0, -0.6, 0.0444444444444444, 0.05555555555555558], [-0.2692307692307693, -0.19117647058823528, 0.9411764705882353, -0.5, -0.05555555555555558, 0.05555555555555558], [-0.0714285714285714, -0.25, 0.4772727272727273, -0.10227272727272729, 0.17500000000000004, 0.19999999999999996, -0.8181818181818181, 0.8181818181818181, -0.5, 0.5, 0.0, -0.6], [0.0, -0.4, 0.4, -0.75], [0.8333333333333334, 0.0, 0.0, -1.0]]
mean_arr = []
std_arr = []
for item in a:
    mean_arr.append(mean(item))
    std_arr.append(std(item))